AngleFromSlope
AngleFromSlope Calculate angle given slope
#include <ToolUtils.h> Toolbox Utilities
short AngleFromSlope(theSlope );
Fixed theSlope ; ratio of dh/dv
returns angle in degrees (-180 to 180)
Given the slope of a line (the dh/dv or the horizontal change divided by the
vertical change between any two points on the line) AngleFromSlope
calculates the angle of that line. The calculation is approximate to the nearest
degree.
theSlope a 4-byte Fixed value; the dh/dv ratio of points on a line.
Returns: a signed short integer representing the angle most closely matching
the specified slope ratio. Positive values are clockwise from vertical
and negative values are counterclockwise.

Notes: The returned angle is expressed in circular degrees, going clockwise with
12 o'clock at 0°, 3 o'clock at 90°, etc. Negative values are
counterclockwise from straight up; e.g., 9 o'clock is -90°.
The following example calculates the slope of a line represented by two
endpoints and uses AngleFromSlope to derive the angle of the line.
Example
#include <ToolUtils.h>
#define INT2FIX(i) ((long) i << 16 )/* short to Fixed conversion macro */
Fixed theSlope;
Point startPt, endPt;
short theAngle, dh, dv;
dh = startPt.h - endPt.h; /* calculate the deltas */
dv = startPt.v - endPt.v;
theSlope = FixRatio( INT2FIX(dh), INT2FIX(dv) ); /* slope=dh/dv */
theAngle = AngleFromSlope( theSlope );